package com.zpark.controller;

import com.zpark.pojo.User;
import com.zpark.service.IUserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * @PackageName: com.zpark.controller
 * @ClassName: UserController
 * @Description:
 * @author: RZS
 * @date: 2024/4/28  8:42
 */
//@RestController
//@RequestMapping("/user")
public class UserController {

    @Autowired
    private IUserService userService;

    @GetMapping("/find_id/{id}")
    public User findId(@PathVariable Integer id){
        return userService.findById(id);
    }

    @GetMapping("/all")
    public List<User> findAll(){
        return userService.findAll();
    }
}
